#region Usings

using System.Linq;
using Rail.Net.Core.Interfaces.Data;
using Rail.Net.Core.Model;
using Rail.Net.Data.Caching;

#endregion

namespace Rail.Net.Data
{
    public class TariffRepository : CacheableRepository<Tariff>, ITariffRepository
    {
        public override IQueryable<Tariff> AllDefaultsIncluded()
        {
            return All(t => t.Administrations, t => t.Rus, t => t.PaymentOptions, t => t.TravelerCombinations,
                       t => t.TravelerCombinations.Select(tr => tr.Travelers),
                       t => t.TravelerCombinations.Select(tr => tr.Travelers.Select(tra => tra.DiscountOptions)));
        }
    }
}